

package com.hazelcast.test.starter.constructor;

import com.hazelcast.test.starter.HazelcastStarterConstructor;

import java.lang.reflect.Constructor;

@HazelcastStarterConstructor(classNames = {"com.hazelcast.core.HazelcastJsonValue"})
public class HazelcastJsonValueConstructor extends AbstractStarterObjectConstructor {

    public HazelcastJsonValueConstructor(Class<?> targetClass) {
        super(targetClass);
    }

    @Override
    Object createNew0(Object delegate) throws Exception {
        Constructor<?> constructor = targetClass.getDeclaredConstructor(String.class);

        Object[] args = new Object[]{delegate.toString()};

        return constructor.newInstance(args);
    }
}
